curriculum();
function curriculum(){
	$.ajax({
		url:URL+"Home/Index/curriculum",
		type:"GET",
		success:function(data){
			$.each(data.data,function(index,obj){
				var title=obj.title,
					people=obj.people,
					ctime=obj.ctime,
					nature=obj.nature,
					tuition=obj.tuition,
					education=obj.education;
				var html="";
					html+=
						'<tr>'+
							'<td>'+title+'</td>'+
							'<td>'+people+'</td>'+
							'<td>'+ctime+'</td>'+
							'<td>'+nature+'</td>'+
							'<td>'+tuition+'</td>'+
							'<td>'+education+'</td>'+
                        '</tr>';
				$(".g-curriculum-introduction1-tbody").append(html);
			})
		},
		error:function(){}
	});
}
// 新闻
news()
function news(){
   $.ajax({
	 url:URL+"Home/Index/news",
	 type:"GET",
	 success:function(data){
	 	$.each(data.news,function(index,obj){
	 		if (index>=5) {
	 			return;
	 		}else{
	 			var html="";
	 		    var title=obj.title,
	 		    time=obj.time;
	 		    ids=obj.id;
	 		    html=
				'<li data-nid="'+ids+'+">'+
					'<a href="#" title="'+title+'">'+
						'<i class="glyphicon glyphicon-play"></i>'+
						'<span class="g-news-text">'+title+'</span>'+
						'<span class="rt">'+time+'</span>'+
						'<b class="clearfix"></b>'+
					'</a>'+
				'</li>';
	 		}
	 		
	 	$(".g-Student-ed-content-items").append(html);
	 	})

     },
     error:function(){}
   });
}
$("body").on("click",".g-Student-ed-content-items li",function(e){
	e.preventDefault();
	var index=$(this).attr("data-nid");
 	sessionStorage.setItem('index',index);
	location.href="/Home/Newsdetaili/newsdetaile?id="+index;
	$(".newscontents").html("");
});
function newsdetaile(){
	var ind=sessionStorage.getItem("index");
	$.ajax({
	  url:URL+"Home/Newsdetaili/newsdetailes",	
	  type:"GET",
	  success:function(data){
       $.each(data.data,function(indexs,obj){
			var newsdetailehtml='';
			var id=obj.id,
	 		   title=obj.title,
	 		   newcontent=obj.newcontent,
	 		   author=obj.author,
	 		   browse=obj.browse,
	 		   source=obj.source,
	 		   time=obj.time,
	 		   type=obj.type,
	 		   title1=obj.title1,
	 		   newcontent1=obj.newcontent1,
	 		   title2=obj.title2,
	 		   newcontent2=obj.newcontent2,
	 		   title3=obj.title3,
	 		   newcontent3=obj.newcontent3;
	 		   if(ind==id){
	 		   	newsdetailehtml+=`
	               <div class="new-titles">
	                   <p>${title}</p>
	                   <div class="new-release">
	                       <span>来源：${source}</span>
	                       <b></b>
	                       <span>作者：${author}</span>
	                       <b></b>
	                       <span>发布时间：${time}</span>
	                       <b></b>
	                       <span>${browse}次浏览</span>
	                   </div>
	               </div>
	                <div class="new-contents">
	                    <p class="text_in">${newcontent}</p>
	                    <p>${title1}</p>
	                    <p class="text_in">${newcontent1}</p>
	                    <p>${title2}</p>
	                    <p class="text_in">${newcontent2}</p>
	                    <p>${title3}</p>
	                    <p class="text_in">${newcontent3}</p>
	                </div>
	               `;	
	            $(".newscontents").html(newsdetailehtml);      
	 		   }
          })
	  },
	  error:function(){

	  }
	})
};
newsdetaile()